<?php
/**
 * CreateTime: 2023/11/24 15:12
 * User:LinQ
 */

namespace App\Http\Controllers\Company;

use App\Http\Controllers\BasicInterfaceController;
use App\Http\Controllers\Controller;
use App\Http\Requests\Company\CompanyRequest;
use App\Http\Requests\System\ListRequest;
use App\Http\Service\Company\CompanyService;

class CompanyController extends Controller implements BasicInterfaceController
{
    public function getList(){
        $request = request()->only('page','page_size','filters','desc');
        (new ListRequest())->check($request);
        (new CompanyService())->getList($request);
    }

    public function getSelectHasPage(){
        $request = request()->only('page','page_size','filters','desc');
        (new ListRequest())->check($request);
        (new CompanyService())->getSelectHasPage($request);
    }

    public function getSelect()
    {
        (new CompanyService())->getSelect();
    }


    public function getInfo($id)
    {
        (new CompanyService())->getInfo($id);
    }

    public function create()
    {
        $request = request()->only('company_name','company_code');
        (new CompanyRequest())->scene('create')->check($request);
        (new CompanyService())->create($request);
    }

    public function update($id)
    {
        $request = request()->only('company_name','company_code');
        $request['company_id'] = $id;
        (new CompanyService())->update($request);
    }

    public function fakeDelete($id)
    {

    }

    public function delete()
    {

    }


    public function fakeDeleteByIds($ids)
    {

    }
}
